package com.steven.concurrency.example.atomic;


import com.steven.concurrency.annoations.ThreadSafe;

import java.util.concurrent.atomic.AtomicReference;

@ThreadSafe
public class AtomicReferenceTest {

    private static AtomicReference<Integer> atomicReference = new AtomicReference<>(0);

    public static void main(String[] args) {
        atomicReference.compareAndSet(0,2);
        atomicReference.compareAndSet(0,3);
        atomicReference.compareAndSet(1,4);
        atomicReference.compareAndSet(2,6);
        System.out.println(atomicReference.get());
    }

}
